package com.octopus.optiworks.dao;

import java.util.List;

import org.springframework.stereotype.Component;

import com.octopus.optiworks.model.DataSheet;

@Component
public class DataSheetDao extends GenericHibernateDao<DataSheet, Long>{
	
	public DataSheet getDataSheetByProduct(Long productId){
		DataSheet dataSheet = null;
		List<DataSheet> list = super.find("from DataSheet d where d.product.id=?", new Long[]{productId});
		if(list != null)
			dataSheet = list.get(0);
		return dataSheet;
	}
}
